import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

const state = {
    btnShow: {
        turntableResultBtn: false, // 转盘查看中奖名单
        turntableResultShow: false, // 转盘中奖名单是否显示
        lotteryBtn: false
    },
    lottery: {
        index: 0,
        prizeList: [],
        who: {
            img: 'http://test3.chenxinliuyi.com/pc/images/who.png',
            name: ''
        }
    },
    turntable: {
        turntableResultList: []
    }
}
const mutations = {
    storageTurntableResultBtn(state, e) {
        state.btnShow.turntableResultBtn = e
    },
    storageTurntableResultShow(state, e) {
        state.btnShow.turntableResultShow = e
    },
    storageLotteryBtn(state, e) {
        state.btnShow.lotteryBtn = e
    },
    storageLotteryInfo(state, e) {
        state.lottery.prizeList = e
    },
    storageTurntableResultList(state, e) {
        state.turntable.turntableResultList = e
    },
    storageLotteryWho(state, e) {
        state.lottery.who.img = e[0]
        state.lottery.who.name = e[1]
    },
    hideAllBtn(state) {
        state.btnShow.turntableResultBtn = false
        state.btnShow.lotteryBtn = false
    }
}

export default new Vuex.Store({
    state, mutations
})
